<template>
  <div>
    <el-pagination small
                   :page-size="limit"
                   :current-page="pageSize"
                   @current-change="pageChange"
                   layout="prev, pager, next"
                   :total="count">
    </el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    count: {
      type: Number,
      default: 0
    },
    limit: {
      type: Number,
      default: 0
    },
    page: {
      type: Number,
      default: 0
    }
  },
  components: {

  },
  data () {
    return {
      pageSize: 0
    };
  },
  computed: {

  },
  watch: {
    // 替换数据
    pageSize: {
      handler (val) {
        this.pageSize = val
      }
    }
  },
  created () {

  },
  mounted () {

  },
  methods: {
    pageChange (page) {
      this.pageSize = page
      this.$emit("pageChange", this.pageSize)
    }
  },
};
</script>

<style scoped lang="less">
</style>
